import React,{useEffect,useContext,useState} from 'react'
import AllUi from './AllUi'
import { useDispatch,useSelector } from 'react-redux'
import {getallList} from '../index'
import httpContext from '@/context/httpContext'

export default function Allcontainer() {
    const dispatch=useDispatch()
    const list=useSelector(state=>state.getIn(['all','alllist']))
    const theme=useSelector(state=>state.getIn(['all','theme']))
    const series=useSelector(state=>state.getIn(['all','series']))
    // console.log(theme);
    useEffect(()=>{
        dispatch(getallList())
    },[])
    const obj={
        'list':list,
        'theme':theme,
        'series':series.slice(0,8)
    }
    // const {get} =useContext(httpContext)
    // const [recommend,setRecommend]=useState([])

    // useEffect(
    //     async ()=>{
    //         let res=await get({
    //             url:'http://localhost:9000/categroydetail'
    //         })
    //         // console.log(res.data.data.list);
    //         setRecommend(res.data.data.list)
    //     },[]
    // )
   
    return (
        <AllUi obj={obj}>  </AllUi>
    )
}
